# -*- coding:utf8 -*- #
# -----------------------------------------------------------------------------------
# ProjectName:  smalleel-hvac-iot-test
# FileName:     hvac_control.py
# Author  :
# Datetime:     2023/5/24 11:18
# Description：
# -----------------------------------------------------------------------------------
from common.util.configUtil.configUtil import ConfigUtil
from common.util.requestsUtil.requestsUtil import RequestsUtil
from core.mqtt.command.command_set import command_params

conf = ConfigUtil()
req = RequestsUtil()


def panel_command_control(deviceNo, actionList, sync=True):
    url = conf.get_control_command(sync)
    params = command_params(deviceNo, actionList)
    print(url)
    print(params)
    res = req.send_request("get", url, params=params, parameterFormat="data")
    print(res)


if __name__ == '__main__':
    # actionList = ["switchOn", "temp", "operate", "speed", "reportPeriod", "energy", "restart", "complexLock", ]
    actionList = ["switchOn" ]
    panel_command_control("P4202300000001", actionList, True)
